tests: allow setup_os_repository to create U-Boot stub config
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Sun, 1 Sep 2013 11:07:17 +0000 (13:07 +0200)
committerColin Walters <walters@verbum.org>
Sun, 15 Sep 2013 16:46:39 +0000 (12:46 -0400)
Currently OSTree supports two bootloader backends: syslinux
and U-Boot; allow to create a stub configuration for both.

https://bugzilla.gnome.org/show_bug.cgi?id=708069

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
tests/libtest.sh

index b05e72bcdbbaf35acd9dffd3ca42113dd9042f24..fc6eef1b7f51753f301959d3d945fbbcfec9ffcc 100644 (file)
@@ -165,6 +165,15 @@ setup_os_boot_syslinux() {
     ln -s ../loader/syslinux.cfg sysroot/boot/syslinux/syslinux.cfg
 }
 
+setup_os_boot_uboot() {
+    # Stub U-Boot configuration
+    mkdir -p sysroot/boot/loader.0
+    ln -s loader.0 sysroot/boot/loader
+    touch sysroot/boot/loader/uEnv.txt
+    # And a compatibility symlink
+    ln -s loader/uEnv.txt sysroot/boot/uEnv.txt
+}
+
 setup_os_repository () {
     mode=$1
     bootmode=$2
@@ -218,9 +227,14 @@ EOF
     ostree admin --sysroot=sysroot init-fs sysroot
     ostree admin --sysroot=sysroot os-init testos
 
-    if [ $bootmode = "syslinux" ]; then
-        setup_os_boot_syslinux
-    fi
+    case $bootmode in
+        "syslinux")
+           setup_os_boot_syslinux
+            ;;
+        "uboot")
+           setup_os_boot_uboot
+            ;;
+    esac
 }
 
 os_repository_new_commit ()